import { connect } from 'react-redux'
import Category from '../../../views/Category'

function mapStateToProps(state: any) {
    return {
        lists: state.cate.lists,
        categorySecondIndex: state.detail.categorySecondIndex
    }
}

function mapDispatchToProps(dispatch: (obj: any) => void) {
    return {
        'SET_CATEGORY': (data: any) => {
            dispatch({ type: 'SET_CATEGORY', data })
        },
        'SET_DETAIL_CATEGORYTHIRDINDEX': (data: any, status: number) => {
            dispatch({ type: 'SET_DETAIL_CATEGORYTHIRDINDEX', data, status})
        },
        'SET_DETAIL_CATEGORYTHIRDLISTINDEX': (data: any, status: number) => {
            dispatch({ type: 'SET_DETAIL_CATEGORYTHIRDLISTINDEX', data, status})
        },
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(Category)